package cn.blmdz.test;

import com.alibaba.fastjson.JSON;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
 * @Auther xpoll
 * @Date 2021/4/25
 *
 * https://jsoup.org/
 * <dependency>
 *     <groupId>org.jsoup</groupId>
 *     <artifactId>jsoup</artifactId>
 *     <version>1.13.1</version>
 * </dependency>
 */
public class JsoupTest3 {
    public static String domain = "https://mp.weixin.qq.com/s?__biz=MzIyMjg2ODExMA==&mid=2247486362&idx=1&sn=b7394f006f7c9b3bf63c78aa79108aec&scene=21#wechat_redirect";


    public static void main(String[] args) throws Exception {
        goon(domain);
    }
    public static void goon(String url) throws Exception {
        System.out.println(url);
        Document doc = Jsoup.connect(url)
                .header("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36")
                .get();
        System.out.println(doc.html());
        System.out.println("---------------------------------------------");
        System.out.println(doc.text());
//        System.out.println(doc.body().html());
//        System.out.println(doc.body().text());
    }
}
